public class Test {
    public static void main(String[] args) {
        //测试过程
        BankAccount bankAccount = new BankAccount(10000);
        System.out.println("====对原有类进行测试====");
        bankAccount.deposit(10);
        System.out.println(bankAccount.getBalance());
        bankAccount.deposit(10);
        System.out.println(bankAccount.getBalance());
        bankAccount.deposit(10);
        System.out.println(bankAccount.getBalance());
        bankAccount.withdraw(10);
        System.out.println(bankAccount.getBalance());
        bankAccount.withdraw(10);
        System.out.println(bankAccount.getBalance());
        bankAccount.withdraw(10);
        System.out.println(bankAccount.getBalance());
        CheckingAccount checkingAccount = new CheckingAccount(1000,1);
        System.out.println("====对增加类 1 做测试====");
        checkingAccount.deposit(10);
        System.out.println(checkingAccount.getBalance());
        checkingAccount.withdraw(10);
        System.out.println(checkingAccount.getBalance());
        System.out.println("====对增加类 2 做测试====");
        SavingAccount savingAccount = new SavingAccount(1000,3,0.01);
        savingAccount.deposit(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.deposit(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.deposit(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.deposit(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.earnMonthlyInterest();
        System.out.println("====通过刷新后====");
        savingAccount.withdraw(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.withdraw(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.deposit(10);
        System.out.println(savingAccount.getBalance());
        savingAccount.deposit(10);
        System.out.println(savingAccount.getBalance());

    }
}
//此程序更深刻的一会的方法重写的重要性，对于只是体现方法重写，没有效验过多的业务逻辑，例如，取钱时的身份效验，调用数据库中用户的各项数据等等
